Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate binds to Android and iOS #53

Merged
merged 30 commits into from
Aug 28, 2024
Merged

Conversation

daniellfalcao
Copy link
Contributor

@daniellfalcao daniellfalcao commented Aug 28, 2024

Description

This pull request configures the Uniffi library from mozilla/uniffi-rs to generate bindings for both Android and iOS from the Rust code in this repository. The configuration was done using Procedural Macros, eliminating the need for a UDL file.

A new module named kos-mobile was created, which generates the necessary code for both Android and iOS. In this module, functions with signatures compatible with Uniffi were implemented. Additionally, tests were conducted for these functions within Rust, as well as for the iOS and Android libraries.

Summary by CodeRabbit

  • New Features

    • Introduced automated workflows for publishing Android and iOS packages upon new releases.
    • Added new scripts for building and cleaning Android and iOS libraries, enhancing development efficiency.
    • Implemented functionality for generating and validating mnemonics, creating wallets, and encrypting/decrypting data in the KOS mobile application.
  • Documentation

    • Created .gitignore files for Android and iOS directories to maintain a clean repository.
  • Tests

    • Implemented unit tests for cryptographic functionalities in the KOS mobile application, ensuring reliability and security.

Copy link

coderabbitai bot commented Aug 28, 2024

Walkthrough

The changes introduce new GitHub Actions workflows for automating the publishing of Android and iOS packages upon release creation. Additionally, several scripts and configuration files are added to support building and testing mobile applications using Rust and Xcode. The modifications expand the project structure to include a mobile package, enhance dependency management, and implement comprehensive testing for cryptographic functionalities.

Changes

File Path Change Summary
.github/workflows/publish-android.yaml New workflow for automating Android package publishing on release creation.
.github/workflows/publish-ios.yaml New workflow for automating iOS framework publishing on release creation.
Cargo.toml Added dependencies and included new package member kos-mobile.
Makefile Introduced new targets for cleaning, building, and testing Android and iOS applications.
packages/kos-mobile/Cargo.toml New package configuration for kos-mobile, defining dependencies and metadata.
packages/kos-mobile/android/.gitignore New .gitignore file to manage ignored files in the Android directory.
packages/kos-mobile/android/build.gradle.kts New Gradle configuration file for Android project setup.
packages/kos-mobile/android/gradle.properties New properties file for Gradle build configuration.
packages/kos-mobile/android/gradle/libs.versions.toml New file for centralized dependency version management.
packages/kos-mobile/android/gradle/wrapper/gradle-wrapper.properties New file for Gradle wrapper configuration.
packages/kos-mobile/android/gradlew New startup script for running Gradle on UNIX-like systems.
packages/kos-mobile/android/gradlew.bat New startup script for running Gradle on Windows systems.
packages/kos-mobile/android/lib/build.gradle.kts New build configuration for the kos-mobile Android library module.
packages/kos-mobile/android/lib/src/main/AndroidManifest.xml New manifest file for the Android application.
packages/kos-mobile/android/lib/src/test/kotlin/uniffi/kos_mobile/KOSTest.kt New unit tests for cryptographic functionalities.
packages/kos-mobile/android/settings.gradle.kts New settings file for managing the Gradle project structure.
packages/kos-mobile/build_android.sh New script for automating the Android library build process.
packages/kos-mobile/build_clean.sh New script for cleaning build artifacts for Android and iOS.
packages/kos-mobile/build_ios.sh New script for automating the iOS library build process.
packages/kos-mobile/build_source.sh New script for setting up the build environment for Android projects.
packages/kos-mobile/ios/.gitignore New .gitignore file for the iOS directory.
packages/kos-mobile/ios/framework/.gitignore New .gitignore file for the iOS framework directory.
packages/kos-mobile/ios/framework/KOSMobile/KOSMobile.xcodeproj/project.pbxproj New Xcode project file for the KOSMobile framework.
packages/kos-mobile/ios/framework/KOSMobile/KOSMobile.xcodeproj/xcshareddata/xcschemes/KOSMobile.xcscheme New scheme file for managing build and test configurations in Xcode.
packages/kos-mobile/ios/framework/KOSMobile/KOSMobile/KOSMobile.h New header file for the KOSMobile framework.
packages/kos-mobile/ios/framework/KOSMobile/KOSMobileTests/KOSMobileTests.swift New unit tests for the KOSMobile framework.
packages/kos-mobile/src/bin/uniffi-bindgen.rs New entry point for Uniffi binding generation.
packages/kos-mobile/src/lib.rs New module for cryptographic functionalities, including mnemonic generation and validation.
packages/kos-sdk/src/chain.rs Enhanced Chain struct with new methods for accessing chains by code.

Poem

🐇 In fields of code, I hop with glee,
New workflows bloom, as bright as can be!
Android and iOS, in harmony sing,
With tests and scripts, oh what joy they bring!
So let’s build and publish, a grand debut,
For every change, a cheer, and a hop too! 🎉


Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@daniellfalcao daniellfalcao marked this pull request as ready for review August 28, 2024 19:37
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

Outside diff range, codebase verification and nitpick comments (1)
packages/kos-sdk/src/chain.rs (1)

22-30: Add a comment to explain the removal of the chain code 0.

The removal of the chain code 0 should be documented to explain why it is necessary.

Add a comment to explain the removal of the chain code 0:

-                // remove the NONE chain
+                // Remove the NONE chain (chain code 0) because it is not a valid chain.
                 map.remove(&0);
Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 29d7bc8 and 81b6797.

Files ignored due to path filters (2)
  • Cargo.lock is excluded by !**/*.lock
  • packages/kos-mobile/android/gradle/wrapper/gradle-wrapper.jar is excluded by !**/*.jar
Files selected for processing (30)
  • .github/workflows/publish-android.yaml (1 hunks)
  • .github/workflows/publish-ios.yaml (1 hunks)
  • Cargo.toml (2 hunks)
  • Makefile (1 hunks)
  • packages/kos-mobile/Cargo.toml (1 hunks)
  • packages/kos-mobile/android/.gitignore (1 hunks)
  • packages/kos-mobile/android/build.gradle.kts (1 hunks)
  • packages/kos-mobile/android/gradle.properties (1 hunks)
  • packages/kos-mobile/android/gradle/libs.versions.toml (1 hunks)
  • packages/kos-mobile/android/gradle/wrapper/gradle-wrapper.properties (1 hunks)
  • packages/kos-mobile/android/gradlew (1 hunks)
  • packages/kos-mobile/android/gradlew.bat (1 hunks)
  • packages/kos-mobile/android/lib/build.gradle.kts (1 hunks)
  • packages/kos-mobile/android/lib/src/main/AndroidManifest.xml (1 hunks)
  • packages/kos-mobile/android/lib/src/test/kotlin/uniffi/kos_mobile/KOSTest.kt (1 hunks)
  • packages/kos-mobile/android/settings.gradle.kts (1 hunks)
  • packages/kos-mobile/build_android.sh (1 hunks)
  • packages/kos-mobile/build_clean.sh (1 hunks)
  • packages/kos-mobile/build_ios.sh (1 hunks)
  • packages/kos-mobile/build_source.sh (1 hunks)
  • packages/kos-mobile/ios/.gitignore (1 hunks)
  • packages/kos-mobile/ios/framework/.gitignore (1 hunks)
  • packages/kos-mobile/ios/framework/KOSMobile/KOSMobile.xcodeproj/project.pbxproj (1 hunks)
  • packages/kos-mobile/ios/framework/KOSMobile/KOSMobile.xcodeproj/xcshareddata/xcschemes/KOSMobile.xcscheme (1 hunks)
  • packages/kos-mobile/ios/framework/KOSMobile/KOSMobile/KOSMobile.h (1 hunks)
  • packages/kos-mobile/ios/framework/KOSMobile/KOSMobileTests/KOSMobileTests.swift (1 hunks)
  • packages/kos-mobile/src/bin/uniffi-bindgen.rs (1 hunks)
  • packages/kos-mobile/src/lib.rs (1 hunks)
  • packages/kos-sdk/Cargo.toml (1 hunks)
  • packages/kos-sdk/src/chain.rs (3 hunks)
Files skipped from review due to trivial changes (12)
  • packages/kos-mobile/android/.gitignore
  • packages/kos-mobile/android/build.gradle.kts
  • packages/kos-mobile/android/gradle.properties
  • packages/kos-mobile/android/gradle/libs.versions.toml
  • packages/kos-mobile/android/gradle/wrapper/gradle-wrapper.properties
  • packages/kos-mobile/android/gradlew
  • packages/kos-mobile/android/gradlew.bat
  • packages/kos-mobile/android/lib/src/main/AndroidManifest.xml
  • packages/kos-mobile/ios/.gitignore
  • packages/kos-mobile/ios/framework/.gitignore
  • packages/kos-mobile/ios/framework/KOSMobile/KOSMobile/KOSMobile.h
  • packages/kos-mobile/src/bin/uniffi-bindgen.rs
Additional context used
Gitleaks
packages/kos-mobile/android/lib/src/test/kotlin/uniffi/kos_mobile/KOSTest.kt

21-21: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

packages/kos-mobile/ios/framework/KOSMobile/KOSMobileTests/KOSMobileTests.swift

22-22: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

SwiftLint
packages/kos-mobile/ios/framework/KOSMobile/KOSMobileTests/KOSMobileTests.swift

[Error] 30-30: Force tries should be avoided

(force_try)


[Error] 33-33: Force tries should be avoided

(force_try)


[Error] 36-36: Force tries should be avoided

(force_try)


[Error] 39-39: Force tries should be avoided

(force_try)


[Error] 42-42: Force tries should be avoided

(force_try)


[Error] 45-45: Force tries should be avoided

(force_try)


[Error] 48-48: Force tries should be avoided

(force_try)


[Error] 51-51: Force tries should be avoided

(force_try)


[Error] 54-54: Force tries should be avoided

(force_try)


[Error] 61-61: Force tries should be avoided

(force_try)

actionlint
.github/workflows/publish-ios.yaml

57-57: shellcheck reported issue in this script: SC2155:warning:3:8: Declare and assign separately to avoid masking return values

(shellcheck)

Shellcheck
packages/kos-mobile/build_source.sh

[warning] 7-7: OS_TOOLCHAIN appears unused. Verify use (or export if used externally).

(SC2034)


[warning] 10-10: ANDROID_JNI_LIBS_PATH appears unused. Verify use (or export if used externally).

(SC2034)


[warning] 11-11: ANDROID_GENERATED_BINDS_PATH appears unused. Verify use (or export if used externally).

(SC2034)


[warning] 13-13: ANDROID_ARCHS appears unused. Verify use (or export if used externally).

(SC2034)


[warning] 14-14: ANDROID_TOOLCHAINS appears unused. Verify use (or export if used externally).

(SC2034)


[warning] 15-15: ANDROID_JNI appears unused. Verify use (or export if used externally).

(SC2034)


[warning] 19-19: IOS_ARCHS appears unused. Verify use (or export if used externally).

(SC2034)


[warning] 20-20: PACKAGE_NAME appears unused. Verify use (or export if used externally).

(SC2034)


[warning] 23-23: ANDROID appears unused. Verify use (or export if used externally).

(SC2034)


[warning] 24-24: IOS appears unused. Verify use (or export if used externally).

(SC2034)


[warning] 92-92: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

(SC2164)

Additional comments not posted (101)
packages/kos-mobile/build_clean.sh (3)

8-11: LGTM!

The function correctly removes the specified Android build artifacts.

The code changes are approved.


13-19: LGTM!

The function correctly removes the specified iOS build artifacts.

The code changes are approved.


21-26: LGTM!

The script correctly logs status messages and calls the cleaning functions.

The code changes are approved.

packages/kos-mobile/android/settings.gradle.kts (3)

3-14: LGTM!

The pluginManagement block correctly configures the repositories for plugins.

The code changes are approved.


16-22: LGTM!

The dependencyResolutionManagement block correctly configures the repositories for dependencies.

The code changes are approved.


24-25: LGTM!

The project settings correctly configure the root project name and include the module.

The code changes are approved.

.github/workflows/publish-android.yaml (4)

1-4: LGTM!

The name and on blocks correctly set the workflow name and trigger.

The code changes are approved.


5-7: LGTM!

The jobs block correctly defines the job for publishing the package.

The code changes are approved.


8-10: LGTM!

The env block correctly sets the environment variables.

The code changes are approved.


11-26: LGTM!

The steps block correctly defines the steps for the job.

The code changes are approved.

packages/kos-mobile/Cargo.toml (5)

1-9: LGTM!

The [package] section is correctly configured with workspace attributes for consistency.

The code changes are approved.


11-12: LGTM!

The [lib] section is correctly configured with appropriate crate types for generating bindings.

The code changes are approved.


14-16: LGTM!

The [[bin]] section is correctly configured with a binary target for uniffi-bindgen.

The code changes are approved.


18-29: LGTM!

The [dependencies] section is correctly configured with workspace dependencies for consistency and maintainability.

The code changes are approved.


31-32: LGTM!

The [build-dependencies] section is correctly configured with uniffi as a build dependency from the workspace.

The code changes are approved.

packages/kos-sdk/Cargo.toml (1)

43-43: LGTM!

The addition of lazy_static as a workspace dependency is a good enhancement for performance and memory management.

The code changes are approved.

Makefile (6)

39-40: LGTM!

The target clean-mobile-build is correctly configured to clean the mobile build environment for the kos-mobile package.

The code changes are approved.


42-43: LGTM!

The target build-android is correctly configured to build the Android application for the kos-mobile package.

The code changes are approved.


45-46: LGTM!

The target publish-android is correctly configured to publish the Android library to a GitHub Packages repository.

The code changes are approved.


48-49: LGTM!

The target build-ios is correctly configured to build the iOS application for the kos-mobile package.

The code changes are approved.


51-58: LGTM!

The target test-ios is correctly configured to test the iOS application using xcodebuild with specified parameters for the iOS Simulator.

The code changes are approved.


60-61: LGTM!

The target test-android is correctly configured to test the Android application using Gradle.

The code changes are approved.

Cargo.toml (4)

9-9: LGTM!

The addition of packages/kos-mobile to the members list is correct.

The code changes are approved.


45-45: LGTM!

The addition of the uniffi dependency is correct and necessary for generating bindings for mobile platforms.

The code changes are approved.


54-54: LGTM!

The addition of the lazy_static dependency is correct and useful for static initialization.

The code changes are approved.


55-55: LGTM!

The addition of the thiserror dependency is correct and useful for error handling.

The code changes are approved.

packages/kos-mobile/android/lib/build.gradle.kts (9)

1-2: LGTM!

The imports of java.net.URI and java.util.Properties are necessary for the configuration and publishing tasks.

The code changes are approved.


4-8: LGTM!

The applied plugins for Android library, Kotlin, and Maven publishing are necessary for building and publishing the Android library.

The code changes are approved.


10-11: LGTM!

The group and version settings are appropriate for the library.

The code changes are approved.


13-33: LGTM!

The Android configuration settings are appropriate and necessary for building the Android library.

The code changes are approved.


36-39: LGTM!

The dependencies for JNA and JUnit are necessary for the library's functionality and testing.

The code changes are approved.


41-52: LGTM!

The publishing configuration for GitHub Packages is appropriate and necessary.

The code changes are approved.


55-61: LGTM!

The publications configuration for the KOS Maven publication is appropriate and necessary.

The code changes are approved.


65-71: LGTM!

The task for copying the Darwin library for testing is appropriate and necessary.

The code changes are approved.


73-77: LGTM!

The afterEvaluate block to ensure the copy task runs before tests is appropriate and necessary.

The code changes are approved.

packages/kos-mobile/android/lib/src/test/kotlin/uniffi/kos_mobile/KOSTest.kt (8)

1-1: LGTM!

The package declaration is appropriate for the test file.

The code changes are approved.


3-5: LGTM!

The imports of JUnit assertions are necessary for the test assertions.

The code changes are approved.


8-8: LGTM!

The class declaration is appropriate for the test file.

The code changes are approved.


10-11: LGTM!

The test method declaration is appropriate for the test file.

The code changes are approved.


23-28: LGTM!

The tests for validating mnemonics are appropriate and necessary.

The code changes are approved.


30-34: LGTM!

The tests for generating mnemonics are appropriate and necessary.

The code changes are approved.


36-52: LGTM!

The tests for encrypting and decrypting data are appropriate and necessary.

The code changes are approved.


54-66: LGTM!

The tests for generating wallets from mnemonics and private keys are appropriate and necessary.

The code changes are approved.

packages/kos-mobile/ios/framework/KOSMobile/KOSMobile.xcodeproj/xcshareddata/xcschemes/KOSMobile.xcscheme (6)

5-24: LGTM!

The BuildAction section is correctly configured.

The code changes are approved.


25-44: LGTM!

The TestAction section is correctly configured.

The code changes are approved.


45-55: LGTM!

The LaunchAction section is correctly configured.

The code changes are approved.


56-71: LGTM!

The ProfileAction section is correctly configured.

The code changes are approved.


72-74: LGTM!

The AnalyzeAction section is correctly configured.

The code changes are approved.


75-78: LGTM!

The ArchiveAction section is correctly configured.

The code changes are approved.

packages/kos-mobile/build_ios.sh (5)

8-13: LGTM!

The configure_cargo function is correctly implemented.

The code changes are approved.


15-22: LGTM!

The assemble_ios_lib function is correctly implemented.

The code changes are approved.


24-29: LGTM!

The generate_binds function is correctly implemented.

The code changes are approved.


31-83: LGTM!

The generate_xcframework function is correctly implemented.

The code changes are approved.


85-97: LGTM!

The main script execution is correctly implemented.

The code changes are approved.

packages/kos-mobile/ios/framework/KOSMobile/KOSMobileTests/KOSMobileTests.swift (2)

11-13: LGTM!

The test case setup is correctly implemented.

The code changes are approved.


24-28: LGTM!

The mnemonic validation tests are correctly implemented.

The code changes are approved.

.github/workflows/publish-ios.yaml (16)

1-4: LGTM!

The workflow is correctly triggered on release creation.

The code changes are approved.


5-6: LGTM!

The permissions are correctly set to write contents.

The code changes are approved.


7-9: LGTM!

The job is correctly configured to run on macOS 14.

The code changes are approved.


10-11: LGTM!

The environment variable TERM is correctly set to xterm.

The code changes are approved.


12-17: LGTM!

The repository is correctly checked out with submodules and full depth.

The code changes are approved.


18-22: Ensure proper error handling for external commands.

The build and test steps are correctly implemented, but consider adding error handling for external commands like brew install protobuf.

Ensure that the external commands are correctly handled in case of failure.


23-25: LGTM!

The checksum is correctly generated for the framework.

The code changes are approved.


26-30: LGTM!

The checksum is correctly uploaded as an artifact.

The code changes are approved.


31-37: LGTM!

The release asset is correctly uploaded using the softprops/action-gh-release action.

The code changes are approved.


39-41: LGTM!

The job is correctly configured to run on macOS 14 and depends on the upload-xcframework job.

The code changes are approved.


42-44: LGTM!

The environment variables TERM and GITHUB_TOKEN are correctly set.

The code changes are approved.


45-50: LGTM!

The repository is correctly checked out with the specified token.

The code changes are approved.


51-55: LGTM!

The checksum is correctly downloaded as an artifact.

The code changes are approved.


65-71: LGTM!

The changes are correctly committed and pushed.

The code changes are approved.


72-91: LGTM!

The release is correctly created using the GitHub API.

The code changes are approved.


56-64: Fix shellcheck warning SC2155.

Declare and assign separately to avoid masking return values.

-  TAG_NAME=${GITHUB_REF#refs/tags/}
+  TAG_NAME="${GITHUB_REF#refs/tags/}"

Apply this diff to fix the issue.

Likely invalid or redundant comment.

Tools
actionlint

57-57: shellcheck reported issue in this script: SC2155:warning:3:8: Declare and assign separately to avoid masking return values

(shellcheck)

packages/kos-mobile/build_android.sh (5)

8-22: Ensure proper error handling for external commands.

The function is correctly implemented, but consider adding error handling for external commands like rustup target add $toolchain.

Ensure that the external commands are correctly handled in case of failure.


24-40: Ensure proper error handling for external commands.

The function is correctly implemented, but consider adding error handling for external commands like cargo build --target $rust_toolchain --release -q.

Ensure that the external commands are correctly handled in case of failure.


42-50: Ensure proper error handling for external commands.

The function is correctly implemented, but consider adding error handling for external commands like cargo build --release -q.

Ensure that the external commands are correctly handled in case of failure.


52-59: Ensure proper error handling for external commands.

The function is correctly implemented, but consider adding error handling for external commands like cargo run -q --bin uniffi-bindgen generate.

Ensure that the external commands are correctly handled in case of failure.


62-80: Ensure proper error handling for external commands.

The script is correctly implemented, but consider adding error handling for external commands like configure_android_ndk and configure_openssl.

Ensure that the external commands are correctly handled in case of failure.

packages/kos-mobile/build_source.sh (7)

29-34: LGTM!

The function is correctly implemented.

The code changes are approved.


37-42: LGTM!

The function is correctly implemented.

The code changes are approved.


45-47: LGTM!

The function is correctly implemented.

The code changes are approved.


49-51: LGTM!

The function is correctly implemented.

The code changes are approved.


53-67: Ensure proper error handling for external commands.

The function is correctly implemented, but consider adding error handling for external commands like curl -0 https://dl.google.com/android/repository/android-ndk-r26b-darwin.dmg.

Ensure that the external commands are correctly handled in case of failure.


69-86: Ensure proper error handling for external commands.

The function is correctly implemented, but consider adding error handling for external commands like curl -L -o "$OPENSSL_VERSION".tar.gz https://github.com/openssl/openssl/releases/download/"$OPENSSL_VERSION"/"$OPENSSL_VERSION".tar.gz.

Ensure that the external commands are correctly handled in case of failure.


88-116: Ensure proper error handling for external commands.

The script is correctly implemented, but consider adding error handling for external commands like ./Configure "$arch" no-asm no-shared.

Ensure that the external commands are correctly handled in case of failure.

Tools
Shellcheck

[warning] 92-92: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

(SC2164)

packages/kos-sdk/src/chain.rs (2)

69-71: LGTM!

The get_by_code method is correctly implemented.

The code changes are approved.


73-75: LGTM!

The get_chains method is correctly implemented.

The code changes are approved.

packages/kos-mobile/src/lib.rs (9)

13-33: LGTM!

The error handling is correctly implemented, providing meaningful error messages and conversions.

The code changes are approved.


35-42: LGTM!

The KOSAccount struct is correctly implemented.

The code changes are approved.


44-47: LGTM!

The generate_mnemonic function is correctly implemented and handles errors appropriately.

The code changes are approved.


49-52: LGTM!

The validate_mnemonic function is correctly implemented and returns a boolean indicating the validity of the mnemonic.

The code changes are approved.


75-89: LGTM!

The generate_wallet_from_private_key function is correctly implemented and handles errors appropriately.

The code changes are approved.


91-107: LGTM!

The encryption functions are correctly implemented and handle errors appropriately.

The code changes are approved.


109-114: LGTM!

The decrypt function is correctly implemented and handles errors appropriately.

The code changes are approved.


116-121: LGTM!

The get_chain_by function is correctly implemented and handles errors appropriately.

The code changes are approved.


123-307: LGTM!

The tests are comprehensive and cover various scenarios, including success and failure cases.

The code changes are approved.

packages/kos-mobile/ios/framework/KOSMobile/KOSMobile.xcodeproj/project.pbxproj (6)

9-17: LGTM!

The PBXBuildFile section is correctly implemented and includes the necessary references.

The code changes are approved.


19-27: LGTM!

The PBXContainerItemProxy section is correctly implemented and includes the necessary proxy.

The code changes are approved.


29-39: LGTM!

The PBXFileReference section is correctly implemented and includes the necessary references.

The code changes are approved.


41-58: LGTM!

The PBXFrameworksBuildPhase section is correctly implemented and includes the necessary references.

The code changes are approved.


61-108: LGTM!

The PBXGroup section is correctly implemented and includes the necessary references.

The code changes are approved.


111-512: LGTM!

The remaining sections are correctly implemented and include the necessary references and settings.

The code changes are approved.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 81b6797 and a1bf1cf.

Files selected for processing (1)
  • packages/kos-mobile/src/lib.rs (1 hunks)
Files skipped from review due to trivial changes (1)
  • packages/kos-mobile/src/lib.rs

@brunocampos-ssa brunocampos-ssa merged commit 9bd6182 into develop Aug 28, 2024
3 checks passed
@brunocampos-ssa brunocampos-ssa deleted the binds_android_ios branch August 28, 2024 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants